import org.apache.commons.lang.StringUtils;
import org.wltea.analyzer.core.IKSegmenter;
import org.wltea.analyzer.core.Lexeme;
import java.io.IOException;
import java.io.StringReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        String str = "A B  C  D   E   F   G  H I J K  L";
        String[] datas = str.split("\\s+", -1);
        System.out.println(datas.length);
        for (String data : datas) {
            System.out.println(data);
        }
        String data = "2021/9/11";
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy/m/dd");
        SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-mm-dd");
        try {
            Date date = sdf1.parse(data);
            System.out.println(date);
            String s = sdf2.format(date);
            System.out.println(s.substring(0, s.length() - 3));
            String[] strings = {"a", "b", "c"};
            System.out.println(StringUtils.join(strings, "\t"));

            System.out.println(Math.abs(-1.1));

            System.out.println(System.currentTimeMillis());
            Date date1 = new Date(System.currentTimeMillis());

            System.out.println(10000 / (99 + 1));
            System.out.println(date1);


            StringReader sr = new StringReader("每个人都要走一条自己坚定了的路，就算是粉身碎骨。 ");
            IKSegmenter ik = new IKSegmenter(sr, true);
            Lexeme lex = null;
            int count = 0;
            while ((lex = ik.next()) != null) {
                count++;
            }
            while ((lex = ik.next()) != null) {
                System.out.print(lex.getLexemeText() + " ");
            }
            System.out.println(count);
            Map<String, Double> map = new HashMap<String, Double>();
            map.put("肖申克的救赎_希望", 0.8);
            Set set = map.keySet();
            String aaa = "希望";

            System.out.println();
            int rand = (int) (Math.random() * 3);
            System.out.println(rand);

            System.out.println(Math.log(100));

            double d1 = Double.parseDouble(String.format("%.4f", 3.3333444));
            System.out.println(d1);

        } catch (ParseException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
